<html>    
  <head> 
    <script type="text/javascript" src="../jquery/jquery-1.4.4.min.js"></script>        
    <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
    <script type="text/javascript" src="../gmap3.js"></script> 
    <style>
      body{
        text-align:center;
      }
      .gmap3{
        margin: 20px auto;
        border: 1px dashed #C0C0C0;
        width: 500px;
        height: 250px;
      }
    </style>
    <script type="text/javascript">
      
    $(function(){
    
      $('#test1').gmap3(
        { action : 'init', mapTypeId : google.maps.MapTypeId.ROADMAP, center:{lat: 40.65,lng: -73.95}, zoom: 12},
        { action: 'addKmlLayer',
          url: 'http://www.searcharoo.net/SearchKml/newyork.kml',
          options:{
            suppressInfoWindows: true
          },
          events:{
            click: function(kml, event){
              $("#test1-text").html(event.featureData.description);
            }
          }
        }
      );
      
      $('#chk').change(function(){
        var map = $('#test1').gmap3('get'),
            kml = $('#test1').gmap3({
              action:'get',
              name:'kmllayer'
            });
        kml.setMap( $(this).is(':checked') ? map : null );
      });
      
    });
    </script>
  </head>
    
  <body>
    <input type="checkbox" id="chk" checked>KML
    <div id="test1" class="gmap3"></div>
    <div id="test1-text"></div>
  </body>
</html>